package com.ruoyi.season.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.appuser.domain.vo.AppuserTaskVo;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.season.domain.PlaySeasonCommonTask;
import com.ruoyi.season.mapper.PlaySeasonCommonTaskMapper;
import com.ruoyi.season.service.IPlaySeasonCommonTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 赛季日常任务Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-14
 */
@Service
public class PlaySeasonCommonTaskServiceImpl extends ServiceImpl<PlaySeasonCommonTaskMapper,PlaySeasonCommonTask> implements IPlaySeasonCommonTaskService
{
    @Autowired
    private PlaySeasonCommonTaskMapper playSeasonCommonTaskMapper;

    /**
     * 查询赛季日常任务
     *
     * @param id 赛季日常任务主键
     * @return 赛季日常任务
     */
    @Override
    public PlaySeasonCommonTask selectPlaySeasonCommonTaskById(String id)
    {
        return playSeasonCommonTaskMapper.selectPlaySeasonCommonTaskById(id);
    }

    /**
     * 查询赛季日常任务列表
     *
     * @param playSeasonCommonTask 赛季日常任务
     * @return 赛季日常任务
     */
    @Override
    public List<PlaySeasonCommonTask> selectPlaySeasonCommonTaskList(PlaySeasonCommonTask playSeasonCommonTask)
    {
        return playSeasonCommonTaskMapper.selectPlaySeasonCommonTaskList(playSeasonCommonTask);
    }

    /**
     * 新增赛季日常任务
     *
     * @param playSeasonCommonTask 赛季日常任务
     * @return 结果
     */
    @Override
    public int insertPlaySeasonCommonTask(PlaySeasonCommonTask playSeasonCommonTask)
    {
        playSeasonCommonTask.setCreateTime(DateUtils.getNowDate());
        return playSeasonCommonTaskMapper.insertPlaySeasonCommonTask(playSeasonCommonTask);
    }

    /**
     * 修改赛季日常任务
     *
     * @param playSeasonCommonTask 赛季日常任务
     * @return 结果
     */
    @Override
    public int updatePlaySeasonCommonTask(PlaySeasonCommonTask playSeasonCommonTask)
    {
        return playSeasonCommonTaskMapper.updatePlaySeasonCommonTask(playSeasonCommonTask);
    }

    /**
     * 批量删除赛季日常任务
     *
     * @param ids 需要删除的赛季日常任务主键
     * @return 结果
     */
    @Override
    public int deletePlaySeasonCommonTaskByIds(String[] ids)
    {
        return playSeasonCommonTaskMapper.deletePlaySeasonCommonTaskByIds(ids);
    }

    /**
     * 删除赛季日常任务信息
     *
     * @param id 赛季日常任务主键
     * @return 结果
     */
    @Override
    public int deletePlaySeasonCommonTaskById(String id)
    {
        return playSeasonCommonTaskMapper.deletePlaySeasonCommonTaskById(id);
    }

    @Override
    public List<AppuserTaskVo> selectPlaySeasonTask(String playSeasonId) {
        return baseMapper.selectPlaySeasonTask(playSeasonId);
    }
}
